package org.abio.XasML.util
{
	import flash.display.Sprite;
	import flash.events.Event;

	public function delayedCall(frame:int, func:Function, ...args):void{
		var tempSprite:Sprite=new Sprite();
		var tempFrame:int=0;
		tempSprite.addEventListener(Event.ENTER_FRAME, function ENTER_FRAME(e:Event):void{
			tempFrame++
			if(tempFrame>=frame){
				tempSprite.removeEventListener(Event.ENTER_FRAME, ENTER_FRAME);
				func.apply(null, args);
			}
		});
	}
}